<?php 
	$email = array(
		'name'	=> 'email',
		'id'	=> 'email',
		'class'	=> 'input ui-corner-all',
		'value' =>   set_value('email', $user_info->email)
	);
	
	$password = array(
		'name'	=> 'password',
		'id'	=> 'password',
		'class'	=> 'input ui-corner-all',
		'value' =>  ''
	);
	
	$profile_name = array(
		'name' 	=> 'profile_name',
		'id'	=> 'profile_name',
		'class'	=> 'input ui-corner-all',
		'style' => 'width: 180px',
		'value' =>  set_value('profile_name', $user_profile->name)
	);
	
	$profile_website = array(
		'name' 	=> 'profile_website',
		'id'	=> 'profile_website',
		'class'	=> 'input ui-corner-all',
		'style' => 'width: 180px',
		'value' =>  set_value('profile_website', $user_profile->website)
	);
	
	foreach ($roles as $role) $options[$role->id] = $role->name;
?>
<div class="container_12" id="body">
	<div class="grid_12">
	<?php echo form_open_multipart('backend/user/update/'.$user_info->id, array('id' => 'form_user_update'));?>
		<div style="text-align: right;">
			<button id="btn_update">Lưu</button> 
			<?php echo anchor('backend/user', 'Hủy', 'class="button"');?>
		</div>
		<?php if ($message): ?>
		<div style="margin: 20px auto; padding: 1em;" class="ui-state-highlight ui-corner-all"> 
			<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"></span>
			<strong>Hey!</strong> <?php echo $message; ?></p>
		</div>
		<div class="clear"></div>
		<?php endif;?>
		<div class="grid_6 alpha">
			<h4>Tài khoản: <?php echo $user_info->username; ?></h4>
			<div class="b10">
				<?php echo form_label('Email', 'email', array('style' => 'width: 120px')); ?>
				<?php echo form_input($email); ?>
				<div class="clear"></div>
			</div>
			<div class="b10">
				<?php echo form_label('Nhóm quản lý', 'role_id', array('style' => 'width: 120px')); ?>
				<?php echo form_dropdown('role_id', $options, array($user_info->role_id), 'id="role_id" class="input ui-corner-all"'); ?>
				<div class="clear"></div>
			</div>
			<div>
				<?php echo form_label('Mật khẩu', 'password', array('style' => 'width: 120px')); ?>
				<?php echo form_password($password); ?>
				<div class="clear"></div>
			</div>
			<div>
				<?php echo form_label('Trạng thái', 'status', array('style' => 'width: 120px')); ?>
				<?php echo form_dropdown('status', array('0' => 'On', '1' => 'Off'), array($user_info->banned), 'id="status" class="input ui-corner-all"'); ?>
				<div class="clear"></div>
			</div>
		</div>
		<div class="grid_6 omega">
			<h4>Hồ sơ</h4>
			<div>
				<?php echo form_label('Họ tên', 'profile_name', array('style' => 'width: 120px')); ?>
				<?php echo form_input($profile_name); ?>
				<div class="clear"></div>
			</div>
			<div>
				<?php echo form_label('Website', 'profile_website', array('style' => 'width: 120px')); ?>
				<?php echo form_input($profile_website); ?>
				<div class="clear"></div>
			</div>
		</div>
		<div class="clear"></div>
	<?php echo form_close();?>
	</div>
	<div class="clear"></div>
</div>
<script type="text/javascript">
</script>